﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using ProtoBuf.Message;

namespace UI
{

    public enum ActivityType//活动类型
    {
        None,       
        EveryDaySign,   //每日签到
        OpenServerRace, //开服竞赛
        AsunaKitchen,   //亚丝娜厨房
        LoginAward,     //登录奖励
        RechargeSurprise,//充值送礼
        FirstRecharge,  //首充礼包
        MonthCard,      //月卡奖励
        VIPBenefits,    //vip福利
        BattleRace,     //竞技场
        RobTrea,        //夺宝送礼
        PrizeTask,      //悬赏任务
        PrizeBoss,      //悬赏Boss
        CopyBenefits,   //福利活动
        MainCopy,       //主线副本
        CostTotal,      //累计消费
        RechargeTotal,   //累计充值
        DiscountSale,   //折扣售卖
        HalfDiscountSale,//半价销售
        OpenSeverMoney,   //开服基金
        AincradStars,     //试炼之地
        Congratulation,   //庆典活动
        OpenHappy,       //开服狂欢
        TimeLimitExchange,//限时兑换
        TimeLimitSail,   //限时抢购
        Festival,         //节日活动
        Update,          //更新活动
        fortuneCat,  //藏宝箱
        continueRechargeGift,  //连冲送礼
        WarriorRescruitTimes, //招募送礼
        CollectionWarrior,    //收集角色
        WarriorWeightImprove, //橙卡招募
        KaiGongActivity,    //攻略福利
        RechangeDouble,     //充值翻倍
    }

    //activity_sign_tab
    //activity_open_server_tab
    //activity_login_award_tab
    //activity_asuna_kitchen_tab
    //activity_recharge_award_tab
    //activity_recharge_first_tab



    [RequireComponent(typeof(UIActivityEvent))]
    [RequireComponent(typeof(UIActivityPanel))]
    public class UIActivity : Page
    {
        [HideInInspector]
        public UIActivityPanel panel;
        [HideInInspector]
        public UIActivityEvent uEvent;
        
        public TweenAlpha topbarAlpha;
        public GameObject green;

        public TweenPosition titlePos;
        public TweenScale tabScale;

        public UISprite tab;
        public const int tabHeight = 60;
        public const int tabStartHeight = 38;
        public UIScrollView scrollView;
        public SimpleGrid simpleGrid;
        public GameObject tabPref;
        public GameObject littleIcon;
        public int showTimes = 0;
        public Dictionary<ActivityType, string> activityIds = new Dictionary<ActivityType, string>();

        //打开时进入tab页
        List<GameObject> tabList = new List<GameObject>();
        List<TweenAlpha> alphas = new List<TweenAlpha>();
        //List<TweenPosition> positions;
        int typeOnOpen = 0;
        GameObject lastTab;
		public GameObject downArrow;


        //public void OpenOrCloseDownArrow(bool b)
        //{
        //    downArrow.SetActive(b);
        //}
        void Awake()
        {
            panel = GetComponent<UIActivityPanel>();
            uEvent = GetComponent<UIActivityEvent>();
            //continueChargeGift.setDownArrow = OpenOrCloseDownArrow;
        }

        protected override void DoOpen()
        {
            if(options.ContainsKey("tab"))
            {
                typeOnOpen = int.Parse(options["tab"]);
            }
            else
            {
                typeOnOpen = 0;
            }

            CSActivityList msg = new CSActivityList();
            NetAPI.SendHttp(OpDefine.CSActivityList, msg, MsgCallback);

            showTimes = 0;
        }

      protected override void DoClose()
        {
            DataMessageTool.RemoveHandler(DataMessage.RED_POINT, ShowOrHideRedPoint);
            panel.OnPageClosed();
        }

        public override void OnCoverPageRemove()
        {
            panel.Refersh();
            panel.OnPageCoverPageRemoved();
        }

        public override void OnCoverPageOpen()
        {
            panel.OnPageCoverPageOpen();
        }
        void MsgCallback(NetWork.Packets.Packet packet, bool success)
        {
            if(success) 
            {
                SCActivityList msg = packet.kBody as SCActivityList;
                List<ActivityType> at = new List<ActivityType>();

                at.Add(ActivityType.EveryDaySign);
                at.Add(ActivityType.AsunaKitchen);

                activityIds.Clear();
                foreach (var item in msg.activityList)
                {
                    string[] strs = item.activityId.Split('_');
                    switch(strs[0])
                    {
                        case "rechargeSingle":
                            {
                                at.Add(ActivityType.RechargeSurprise);
                                activityIds[ActivityType.RechargeSurprise] = item.activityId;
                            }
                            break;
                        case "totalLogin":
                            {
                                at.Add(ActivityType.LoginAward);
                                activityIds[ActivityType.LoginAward] = item.activityId;
                            }
                            break;
                        case "kaiFuJingSai":
                            {
                                at.Add(ActivityType.OpenServerRace);
                                activityIds[ActivityType.OpenServerRace] = item.activityId;
                            }
                            break; 
                        case "firstRecharge":
                            {
                                at.Add(ActivityType.FirstRecharge);
                                activityIds[ActivityType.FirstRecharge] = item.activityId;
                            }
                            break;
                        case "monthCard":
                            {
                                at.Add(ActivityType.MonthCard);
                                activityIds[ActivityType.MonthCard] = item.activityId;
                            }
                            break;
                        case "vipBoon":
                            {
                                at.Add(ActivityType.VIPBenefits);
                                activityIds[ActivityType.VIPBenefits] = item.activityId;
                            }
                            break;
                        case "pvpWinTimes":
                            {
                                at.Add(ActivityType.BattleRace);
                                activityIds[ActivityType.BattleRace] = item.activityId;
                            }
                            break;
                        case "robTreasureTimes":
                            {
                                at.Add(ActivityType.RobTrea);
                                activityIds[ActivityType.RobTrea] = item.activityId;
                            }
                            break;
                        case "fightRedNameTimes":
                            {
                                at.Add(ActivityType.PrizeTask);
                                activityIds[ActivityType.PrizeTask] = item.activityId;
                            }
                            break;
                        case "killRedNameTimes":
                            {
                                at.Add(ActivityType.PrizeBoss);
                                activityIds[ActivityType.PrizeBoss] = item.activityId;
                            }
                            break;
                        case "mainCopyWinTimes":
                            {
                                at.Add(ActivityType.MainCopy);
                                activityIds[ActivityType.MainCopy] = item.activityId;
                            }
                            break;
                        case "openServerFund":
                            {
                                at.Add(ActivityType.OpenSeverMoney);
                                activityIds[ActivityType.OpenSeverMoney] = item.activityId;
                            }
                            break;
                        case "costTotal":
                            {
                                at.Add(ActivityType.CostTotal);
                                activityIds[ActivityType.CostTotal] = item.activityId;
                            }
                            break;
                        case "rechargeTotal":
                            {
                                at.Add(ActivityType.RechargeTotal);
                                activityIds[ActivityType.RechargeTotal] = item.activityId;
                            }
                            break;
                        case "halfDiscountSale":
                            {
                                at.Add(ActivityType.HalfDiscountSale);
                                activityIds[ActivityType.HalfDiscountSale] = item.activityId;
                            }
                            break;
                        case "discountSale":
                            {
                                at.Add(ActivityType.DiscountSale);
                                activityIds[ActivityType.DiscountSale] = item.activityId;
                            }
                            break; 
                        case "aincradStars":
                            {
                                at.Add(ActivityType.AincradStars);
                                activityIds[ActivityType.AincradStars] = item.activityId;
                            }
                            break;
                        case "allCopyDouble":
                            {
                                at.Add(ActivityType.CopyBenefits);
                                activityIds[ActivityType.CopyBenefits] = item.activityId;
                            }
                            break;
                        case "openServerSpree":
                            {
                                at.Add(ActivityType.OpenHappy);
                                activityIds[ActivityType.OpenHappy] = item.activityId;
                            }
                            break;
                        case "celebrationActivity":
                            {
                                at.Add(ActivityType.Congratulation);
                                activityIds[ActivityType.Congratulation] = item.activityId;
                            }
                            break;
                        case "limitExchange":
                            {
                                at.Add(ActivityType.TimeLimitExchange);
                                activityIds[ActivityType.TimeLimitExchange] = item.activityId;
                            }
                            break;
                        case "limitSale":
                            {
                                at.Add(ActivityType.TimeLimitSail);
                                activityIds[ActivityType.TimeLimitSail] = item.activityId;
                            }
                            break;
                        case "festival":
                            {
                                at.Add(ActivityType.Festival);
                                activityIds[ActivityType.Festival] = item.activityId;
                            }
                            break;
                        case "update":
                            {
                                at.Add(ActivityType.Update);
                                activityIds[ActivityType.Update] = item.activityId;
                            }
                            break;
                        case "fortuneCat":
                            {
                                at.Add(ActivityType.fortuneCat);
                                activityIds[ActivityType.fortuneCat] = item.activityId;
                            }
                            break;
                        case "continuedRecharge":
                            {
                                at.Add(ActivityType.continueRechargeGift);
                                activityIds[ActivityType.continueRechargeGift] = item.activityId;
                            }
                            break;
                        case "warriorRescruitTimes":
                            {
                                at.Add(ActivityType.WarriorRescruitTimes);
                                activityIds[ActivityType.WarriorRescruitTimes] = item.activityId;
                            }
                            break;
                        case "warriorGetSpecial":
                            {
                                at.Add(ActivityType.CollectionWarrior);
                                activityIds[ActivityType.CollectionWarrior] = item.activityId;
                            } 
                            break;
                         case "warriorWeightImprove":
                            {
                                at.Add(ActivityType.WarriorWeightImprove);
                                activityIds[ActivityType.WarriorWeightImprove] = item.activityId;
                            }
                            break;
                        case "kaiGongActivity":
                            {
                                at.Add(ActivityType.KaiGongActivity);
                                activityIds[ActivityType.KaiGongActivity] = item.activityId;
                            } 
                            break;
                        case "RechangeDouble":
                            {
                                at.Add(ActivityType.RechangeDouble);
                                activityIds[ActivityType.RechangeDouble] = item.activityId;
                            }
                            break;
                    }
                }
                
                Init(at);
                DataMessageTool.AddHandler(DataMessage.RED_POINT, ShowOrHideRedPoint);//红点消息处理委托
                ShowOrHideRedPoint(new object());
            }
        }

        protected void Init(List<ActivityType> at)
        {
            //List<ActivityType> at;
            //ModuleOpened(out at);
            panel.Init(at);

            tab.height = tabStartHeight + (at.Count * tabHeight);
            if (tab.height > 517) {
                tab.height = 517;
                scrollView.enabled = true;
            }
            else
            {
                scrollView.enabled = false;
            }
            InitTabs(at);

            if(typeOnOpen != 0 && activityIds.ContainsKey((ActivityType)typeOnOpen))
                Show((ActivityType)typeOnOpen);
            else
                Show(at[0]);

            //if (typeOnOpen == 0)
            //    Show(at[0]);
            //else
            //    Show((ActivityType)typeOnOpen);


            titlePos.ResetToBeginning();
            titlePos.PlayForward();
            tabScale.ResetToBeginning();
            tabScale.PlayForward();
            //lineScale.ResetToBeginning();
            //lineScale.PlayForward();
            //lineAlpha.ResetToBeginning();
            //lineAlpha.PlayForward();
        }

        /// <summary>
        /// 从服务器请求开启的模块
        /// </summary>
        /// <param name="at"></param>
        //protected void ModuleOpened(out List<ActivityType> at)
        //{
        //    at = new List<ActivityType>();

        //    at.Add(ActivityType.EveryDaySign);
        //    at.Add(ActivityType.OpenServerRace);
        //    at.Add(ActivityType.AsunaKitchen);
        //    at.Add(ActivityType.LoginAward);
        //    at.Add(ActivityType.RechargeSurprise);
        //    at.Add(ActivityType.FirstRecharge);
        //    at.Add(ActivityType.MonthCard);
        //    at.Add(ActivityType.BattleRace);
        //    at.Add(ActivityType.RobTrea);
        //    at.Add(ActivityType.PrizeBoss);
        //    at.Add(ActivityType.PrizeTask);
        //    at.Add(ActivityType.MainCopy);
        //    at.Add(ActivityType.CostTotal);
        //    at.Add(ActivityType.RechargeTotal);
        //    at.Add(ActivityType.AincradStars);
        //    at.Add(ActivityType.Benefits);
        //}

        List<GameObject> littleIcons = new List<GameObject>();

        protected void InitTabs(List<ActivityType> ats)
        {
            foreach(var obj in littleIcons)
            {
                GameObject.Destroy(obj);
            }
            littleIcons.Clear();

            foreach (var item in simpleGrid.childs)
                Destroy(item);
            simpleGrid.childs.Clear();
            tabList.Clear();
            alphas.Clear();
            int index = 0;
            foreach (var at in ats)
            {
                GameObject tab = Instantiate(tabPref);
                tab.SetActive(true);
                tab.name = at.ToString();
                simpleGrid.AddChild(tab);
                tabList.Add(tab);
                BuildLittleIcon(at, tab.transform);
                var script = tab.GetComponent<UIActivityTabs>();
                script.mask.SetActive(false);
                alphas.Add(script.alpha);
                switch (at)
                {
                    case ActivityType.EveryDaySign:
                        script.name_label.text = TableTextBlo.GetText("activity_sign_tab");
                        redTips[0] = script.redPoint;
                        script.events.onClick = uEvent.OnClickEveryDaySign;
                        break;
                    case ActivityType.AsunaKitchen:
                        script.name_label.text = TableTextBlo.GetText("activity_asuna_kitchen_tab");
                        redTips[1] = script.redPoint;
                        script.events.onClick = uEvent.OnClickAsunaKitchent;
                        break;
                    case ActivityType.FirstRecharge:
                        script.name_label.text = TableTextBlo.GetText("activity_recharge_first_tab");
                        redTips[4] = script.redPoint;
                        script.events.onClick = uEvent.OnClickFirstRecharge;
                        break;
                    case ActivityType.LoginAward:
                        script.name_label.text = TableTextBlo.GetText("activity_login_award_tab");
                        redTips[2] = script.redPoint;
                        script.events.onClick = uEvent.OnClickLoginAward;
                        break;
                    case ActivityType.OpenServerRace:
                        script.name_label.text = TableTextBlo.GetText("activity_open_server_tab");
                        script.events.onClick = uEvent.OnClickOpenServerRace;
                        break;
                    case ActivityType.RechargeSurprise:
                        script.name_label.text = TableTextBlo.GetText("activity_recharge_award_tab");
                        redTips[3] = script.redPoint;
                        script.events.onClick = uEvent.OnClickRechargeSurprise;
                        break;
                    case ActivityType.MonthCard:
                        script.name_label.text = TableTextBlo.GetText("receiveMonthCard");
                        redTips[5] = script.redPoint;
                        script.events.onClick = uEvent.OnClickMonthCard;
                        break;
                    case ActivityType.VIPBenefits:
                        script.name_label.text = TableTextBlo.GetText("vip_benefits");
                        redTips[6] = script.redPoint;
                        script.events.onClick = uEvent.OnClickVipBenefits;
                        break;
                    case ActivityType.BattleRace:
                        script.name_label.text = TableTextBlo.GetText("BattleRace_Tab_Name");
                        redTips[14] = script.redPoint;
                        script.events.onClick = uEvent.OnClickBattleRace;
                        break;
                    case ActivityType.RobTrea:
                        script.name_label.text = TableTextBlo.GetText("RobTrea_activity_tab_title");
                        redTips[13] = script.redPoint;
                        script.events.onClick = uEvent.OnClickRobTrea;
                        break;
                    case ActivityType.PrizeTask:
                        script.name_label.text = TableTextBlo.GetText("activity_Prize_Task_tab");
                        redTips[11] = script.redPoint;
                        script.events.onClick = uEvent.OnClickPrizeTask;
                        break;
                    case ActivityType.PrizeBoss:
                        script.name_label.text = TableTextBlo.GetText("activity_Prize_Boss_tab");
                        redTips[12] = script.redPoint;
                        script.events.onClick = uEvent.OnClickPrizeBoss;
                        break;
                    case ActivityType.MainCopy:
                        script.name_label.text = TableTextBlo.GetText("copy_title_name");
                        redTips[15] = script.redPoint;
                        script.events.onClick = uEvent.OnClickMainCopy;
                        break;
                    case ActivityType.CostTotal:
                        script.name_label.text = TableTextBlo.GetText("activity_costTotal_tab");
                        redTips[17] = script.redPoint;
                        script.events.onClick = uEvent.OnClickCostTotal;
                        break;
                    case ActivityType.RechargeTotal:
                        script.name_label.text = TableTextBlo.GetText("activity_chargeTotal_tab");
                        redTips[9] = script.redPoint;
                        script.events.onClick = uEvent.OnClickRechargeTotal;
                        break;
                    case ActivityType.HalfDiscountSale:
                        script.name_label.text = TableTextBlo.GetText("activity_Half_Sail_tab");
                        script.events.onClick = uEvent.OnClickHalfDiscount;
                        break;
                    case ActivityType.DiscountSale:
                        script.name_label.text = TableTextBlo.GetText("activity_Discount_Sail_tab");
                        script.events.onClick = uEvent.OnClickDiscountSale;
                        break;
                    case ActivityType.AincradStars:
                        script.name_label.text = TableTextBlo.GetText("levelUpUnlockName_8");
                        redTips[16] = script.redPoint;
                        script.events.onClick = uEvent.OnClickAincradStars;
                        break;
                    case ActivityType.CopyBenefits:
                        script.name_label.text = TableTextBlo.GetText("activity_Benefits_tab");
                        script.events.onClick = uEvent.OnClickBenefits;
                        break;
                    case ActivityType.OpenSeverMoney:
                        script.name_label.text = TableTextBlo.GetText("activity_openServer_Money_tab");
                        redTips[10] = script.redPoint;
                        script.events.onClick = uEvent.OnClickOpenSeverMoney;
                        break;
                    case ActivityType.OpenHappy:
                        script.name_label.text = TableTextBlo.GetText("open_sever_Happy_Tab");
                        redTips[7] = script.redPoint;
                        script.events.onClick = uEvent.OnClickOpenHappy;
                        break;
                    case ActivityType.Congratulation:
                        script.name_label.text = TableTextBlo.GetText("congratulation_activity_Tab");
                        redTips[8] = script.redPoint;
                        script.events.onClick = uEvent.OnClickCongratulation;
                        break;
                    case ActivityType.TimeLimitExchange:
                        script.name_label.text = TableTextBlo.GetText("Time_Limit_Change_Tab");
                        script.events.onClick = uEvent.OnClickTimeLimitExchange;
                        break;
                    case ActivityType.TimeLimitSail:
                        script.name_label.text = TableTextBlo.GetText("Time_Limit_Buy_Tab");
                        script.events.onClick = uEvent.OnClickTimeLimitSail;
                        break;
                    case ActivityType.Festival:
                        script.name_label.text = TableTextBlo.GetText("activity_festival_Tab");
                        redTips[18] = script.redPoint;
                        script.events.onClick = uEvent.OnClickFestival;
                        break;
                    case ActivityType.Update:
                        script.name_label.text = TableTextBlo.GetText("activity_update");
                        redTips[20] = script.redPoint;
                        script.events.onClick = uEvent.OnClickUpdate;
                        break;
                    case ActivityType.fortuneCat:
                        script.name_label.text = TableTextBlo.GetText("activity_treasurecast");
                        redTips[19] = script.redPoint;
                        script.events.onClick = uEvent.OnClickTreasureCast;
                        break;
                    case ActivityType.continueRechargeGift:
                        script.name_label.text = TableTextBlo.GetText("activity_continue_recharge_gift");
                        redTips[21] = script.redPoint;
                        script.events.onClick = uEvent.OnClickContinueRechargeGift;
                        break;
                    case ActivityType.WarriorRescruitTimes:
                        script.name_label.text = TableTextBlo.GetText("activity_warriorRescruitTimes_tab");
                        redTips[22] = script.redPoint;
                        script.events.onClick = uEvent.OnClickWarriorRescruitTimes;
                        break;
                    case ActivityType.CollectionWarrior:
                        script.name_label.text = TableTextBlo.GetText("activity_collection_warrior_tab");
                        redTips[23] = script.redPoint;
                        script.events.onClick = uEvent.OnClickCollectionWarrior;
                        break;
                    case ActivityType.WarriorWeightImprove:
                        script.name_label.text = TableTextBlo.GetText("activity_warrior_weight_improve_tab");
                        //redTips[24] = script.redPoint;
                        script.events.onClick = uEvent.OnClickWarriorWeightImprove;
                        break;

                    case ActivityType.KaiGongActivity:
                        script.name_label.text = TableTextBlo.GetText("activity_raiders_welfare_tab") ;
                        redTips[24] = script.redPoint;
                        script.events.onClick = uEvent.OnClickKaiGongActivity;
                        break;
                    case ActivityType.RechangeDouble:
                        script.name_label.text = TableTextBlo.GetText("");
                        script.events.onClick = uEvent.OnClickRechangeDouble;
                        break;
                        
                }
            }
            tabCount = index;
			downArrow.SetActive (ats.Count > 8);
        }
        //显示提示
        int tabCount = 0;
        bool flag;
        void Update()
        {
            bool isShow = (tabCount > 7 && scrollView.transform.localPosition.y < (tabCount - 8) * 60);
            if(flag != isShow)
            {
                green.SetActive(isShow);
                flag = isShow;
            }
        }

        private void BuildLittleIcon(ActivityType at,Transform parent)
        {
            GameObject inst = Instantiate(littleIcon) as GameObject;
            inst.SetActive(true);
            inst.transform.SetParent(parent);
            inst.transform.localScale = Vector3.one;
            inst.transform.localPosition = new Vector3(-45,0,0);
            inst.transform.SetParent(parent);
            littleIcons.Add(inst);
            inst.name = at.ToString();
            var script = inst.GetComponent<UIActivitySmallIcon>();
            script.Init(at);
        }

        public void Show(ActivityType at)
        {
            foreach (var obj in tabList)
            {
                obj.GetComponent<UIActivityTabs>().mask.SetActive(obj.name == at.ToString());
            }

            foreach (var icon in littleIcons)
            {
                var script = icon.GetComponent<UIActivitySmallIcon>();
                script.Actived(icon.name == at.ToString());
            }
            
            panel.Show(at);
        }


        public void PlayTweener()
        {
            
            if(showTimes == 0)
            {
                //foreach (var alpha in alphas) alpha.delay = 0.1f;
                foreach (var alpha in alphas)
                {
                    alpha.ResetToBeginning();
                    alpha.PlayForward();
                }
            }
            
            //foreach(var pos in positions)
            //{
            //    pos.ResetToBeginning();
            //    pos.PlayForward();
            //}

            showTimes++;
        }

        void ShowOrHideRedPoint(object redPoint)
        {
            bool showOrHide = StaticData.redTips.GetStateByType(RedPointTip.Red.dailySignLuxury) || StaticData.redTips.GetStateByType(RedPointTip.Red.dailySignOrdinary); 
            if (!showOrHide)
                StaticData.redTips.HideByType(RedPointTip.Red.dailySign);

            StaticData.redTips.RedAcrtivitys = 0;


            List<bool> showState = new List<bool>();
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.dailySign));                //每日登录
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.moonlightRestaurant));      //月光餐厅
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.totalLogin));               //累计登录
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.rechargeSingle));           //单充送礼
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.firstRechargeGift));        //首充礼包
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.monthCardReward));          //月卡        5

            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.vipBoon));                  //VIP福利
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.openServerSpree));          //开服狂欢
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.celebrationActivity));      //庆典活动
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.rechargeTotal));            //累充奖励 

            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.openServerFund));             //开服基金     10
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.fightRedNameTimes));          //攻打叛军数
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.killRedNameTimes));           //击杀叛军数
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.robTreasureTimes));           //夺宝次数
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.pvpWinTimes));               //竞技场
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.mainCopyWinTimes));          //主线副本     15
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.aincradStars));              //试炼之地
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.costTotal));                 //累计消费
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.festival));                  //节日活动
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.fortuneCat));                //藏宝箱活动
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.update));                    //更新活动     20
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.continuedRecharge));        //连充送礼
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.warriorRescruitTimes));        //招募送礼
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.warriorGetSpecial));        //招募送礼
            //showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.warriorWeightImprove));     //橙卡招募
            showState.Add(StaticData.redTips.GetStateByType(RedPointTip.Red.kaiGongActivity));     //橙卡招募


            for (int i = 0;i< showState.Count; i++)
            {
                if (redTips[i])
                {
                    redTips[i].SetActive(showState[i]);
                    if (showState[i])
                        StaticData.redTips.AddActivitys();
                }
            }
        }
    }
}